package com.education.service.edu.feign;

import com.education.result.R;
import com.education.service.edu.feign.fallback.OssFileServiceFallBack;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.stereotype.Service;
import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestBody;

/**
 * 模拟远程调用
 * Created by Lance on 2020/06/24 9:59
 */
@Service                          // 指定容错类 OssFileServiceFallBack
@FeignClient(value = "online-education-service-oss", fallback = OssFileServiceFallBack.class)
public interface OssFileService {

    /**
     * 模拟远程接口
     * @return
     */
    @GetMapping("/admin/oss/file/test")
    R test();

    /**
     * 删除头像的控制器
     * @param url
     * @return
     */
    @DeleteMapping("/admin/oss/file/remove")
    public R removeFile(@RequestBody String url);
}
